<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.kaede.alimama.AlimamaHelper"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
	String url = request.getParameter("url");
	String result = AlimamaHelper.getUrl(url);
	if(result == null)
		out.print("获取失败，请重试！<a href='index.jsp'>返回</a>");
	else if(result.length() == 0)
		out.print("该商品无返利！<a href='index.jsp'>返回</a>");
	else
		response.sendRedirect(result);
%>
</body>
</html>